import pylast

# You have to have your own unique two values for API_KEY and API_SECRET
# Obtain yours from https://www.last.fm/api/account/create for Last.fm
API_KEY = "ab84add1b7f556f3ac7ba136486be63e"  # this is a sample key
API_SECRET = "114dd35fa871561a31c338516bb18c7e"

# In order to perform a write operation you need to authenticate yourself
username = "ChiZLing"
password_hash = pylast.md5("zcy_1097799587")

network = pylast.LastFMNetwork(
    api_key=API_KEY,
    api_secret=API_SECRET,
    username=username,
    password_hash=password_hash,
)

# Now you can use that object everywhere
track = network.get_track("Iron Maiden", "The Nomad")
m=track.love()
track.add_tags(("awesome", "favorite"))

print(track)

artist = network.get_artist("Cher")
print(artist)
